﻿using System;
using System.Collections;
using SharpTrainer.Util;
using Zeus.Thunder.Core;

namespace SharpTrainer.Collections
{
    class HashtableTest : ITestCase
    {
        public void Run()
        {
            var tbl = new Hashtable();
            tbl.Add("Bart", 26);
            tbl["John"] = 62;
            bool bartIsKnown = tbl.ContainsKey("Bart");
            bool someIsAged62 = tbl.ContainsValue(62);
            Display(tbl);

            Console.WriteLine("Removed Bart");
            tbl.Remove("Bart");
            Display(tbl);
        }

        private void Display(Hashtable tbl)
        {
            CollectionUtil.PringHashTable(tbl);
        }
    }
}
